<h5><i class="icon-star"></i> <?=$t_facilidade;?></h5>

<div id="facservice">
<div style="max-width: 340px; padding: 8px 0;" class="well">
    <ul class="nav nav-list">
        <?php
        $sql = "SELECT * FROM facilidadearea WHERE sta_id='1' ORDER BY fac_are_nome";
        $res = sql($sql);
        while($linha=  mysql_fetch_array($res)){
        ?>
            <li class="nav-header"><?=$linha['fac_are_nome'];?></li>
            <?php
            $sql1 = "SELECT * FROM facilidade WHERE are_id='{$linha['fac_are_id']}' AND sta_id='1'";
            $res1 = sql($sql1);
            while($linha1 = mysql_fetch_array($res1)){
                if ($linha1['fac_url'] != "") { $url = "{$linha1['fac_url']}"; } else { $url = $linha1['fac_site']; }
            ?>
            <li><a href="<?=$url;?>" target="_blank"><?=ucfirst(strtolower($linha1['fac_nome']));?></a></li>
        <?php 
            }
        } 
        ?>
    </ul>
</div>
</div>